{% extends "base.html" %}
{% load i18n %}
{% block title %} Tu Negocio Empresarios - Generar Ingreso Dinero{% endblock %}

{% block head-css-ext %}
    <link rel="stylesheet" type="text/css" href="{{MEDIA_URL}}css/layout.css" media="screen" />
    <link rel="stylesheet" type="text/css" href="{{MEDIA_URL}}css/jquery-ui.css" media="screen" />
    <link rel="stylesheet" type="text/css" href="{{MEDIA_URL}}css/ui.datepicker.css" media="screen" />
    <link rel="stylesheet" type="text/css" href="{{MEDIA_URL}}css/forms.css" media="screen" />
{% endblock %}

{% block head-js-ext %}
    <!-- jQuery -->
    <script type="text/javascript" src="{{MEDIA_URL}}js/jquery.js"></script>
    <script type="text/javascript" src="{{MEDIA_URL}}js/jquery-ui.js"></script>
    <script type="text/javascript" src="{{MEDIA_URL}}js/jquery.ui.datepicker-es.js"></script>
    <!--[if IE]><script type="text/javascript" src="{{MEDIA_URL}}js/jquery.bgiframe.js"></script><![endif]-->
{% endblock %}


{% block head-js-embedded %}
    <script type="text/javascript" charset="utf-8">
        $(document).ready(function(){
            var year = new Date().getFullYear();      
            $("input:reset, input:submit", ".enviar").button();
      
            $("#datepicker").datepicker({
                firstDay: 0,
                dateFormat: 'yy-mm-dd',
                yearRange: '1900' + ':' + year, 
                changeMonth: true,
                changeYear: true,
                showOn: 'button',
                buttonImage: '{{MEDIA_URL}}img/calendar.gif',
                buttonImageOnly: true,
                showButtonPanel: true,
                maxDate : new Date()
            });
      
            $("input:reset").click(function(){
                var href = "{% url flujo_caja %}"
                location.href = href;        
            });      
        }); 
    </script>
{% endblock %}

{% block content-box1 %}
    <form method="post" action="." id="notas">{% csrf_token %}
        <table>
            <tr>
                <td><label for="id_valor">Valor:</label>{% if form.valor.errors %} <div class="error">{{ form.valor.errors|join:", " }}</div>{% endif %}</td>
                <td>{{ form.valor }}</td>        
            </tr>  
            <tr>
                <td><label for="id_fecha">Fecha:</label>{% if form.fecha.errors %} <div class="error">{{ form.fecha.errors|join:", " }}</div>{% endif %}</td>
                <td>{{ form.fecha }}</td>
            </tr>
            <tr>
                <td><label for="id_descripcion">Descripción:</label>{% if form.descripcion.errors %} <div class="error">{{ form.descripcion.errors|join:", " }}</div>{% endif %}</td>
                <td>{{ form.descripcion }}</td>        
            </tr>
            <tr>
                <td></td>
                <td align="center" >
                    <table>
                        <tr class="enviar">
                            <td><input type="submit" value="Generar Ingreso"/></td>    
                            <td><input type="reset" value="Cancelar"></td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </form>    
{% endblock %}